﻿namespace HuaWei
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using DevExpress.XtraTreeList;
    using DevExpress.XtraTreeList.Columns;
    using HuaWei.CommClass;
    using HuaWei.Windows.Forms;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class FrmDyqd : Form
    {
        public string bdid;
        public BindingSource bsJLQD;
        private SimpleButton btnPage1Next;
        private SimpleButton btnSave;
        public decimal CJBL;
        private TreeListColumn colBZ;
        private TreeListColumn colDW1;
        private TreeListColumn colHTJE;
        private TreeListColumn colHTSL;
        private TreeListColumn colQDBH1;
        private TreeListColumn colQDLX;
        private TreeListColumn colQDMC;
        private TreeListColumn colSGTJE;
        private TreeListColumn colSGTSL;
        private TreeListColumn colZBDJ;
        public DataTable dtQd;
        public string fileName = "";
        private GridControl gridControl1;
        private GridView gridView1;
        private IContainer icontainer = null;
        private PanelControl panelControl1;
        private PanelControl panelControl2;
        private PanelControl panelControl3;
        private PictureBox pictureBox1;
        private RepositoryItemComboBox repositoryItemComboBox1;
        private RepositoryItemImageComboBox repositoryItemImageComboBox1;
        private RepositoryItemLookUpEdit repositoryItemLookUpEdit1;
        private SimpleButton simpleButton2;
        private TreeList tlQD;
        public string xmid;
        private XtraTabControl xtraTabControl1;
        private XtraTabPage xtraTabPage1;
        private XtraTabPage xtraTabPage2;

        public FrmDyqd()
        {
            this.InitializeComponent();
            this.xtraTabControl1.ShowTabHeader = DefaultBoolean.False;
        }

        private void btnPage1Next_Click(object sender, EventArgs e)
        {
            string str = this.gridView1.FocusedValue.ToString();
            int result = 0;
            if (!str.Equals("") && (str.Length == 3))
            {
                if (int.TryParse(str.Substring(0, 3), out result))
                {
                    int rowPos = DHelp.GetRowPos(this.gridControl1);
                    int visibleIndex = this.gridView1.FocusedColumn.VisibleIndex;
                    string[] fieldName = new string[this.gridView1.Columns.Count - visibleIndex];
                    for (int i = 0; i < fieldName.Length; i++)
                    {
                        fieldName[i] = this.gridView1.VisibleColumns[visibleIndex + i].FieldName;
                    }
                    try
                    {
                        this.bsJLQD.DataSource = null;
                        DataTable dataTable = ReadWriterExcel.GetData(this.fileName, fieldName, rowPos);
                        this.dtQd.Clear();
                        this.method4(dataTable, this.dtQd);
                        this.bsJLQD.DataSource = this.dtQd;
                        this.tlQD.ExpandAll();
                        this.xtraTabControl1.SelectedTabPageIndex++;
                        return;
                    }
                    catch (Exception exception)
                    {
                        throw exception;
                    }
                }
                MsgBox.ShowMsg("请正确选择清单导入起启位置！");
            }
            else
            {
                MsgBox.ShowMsg("请正确选择清单导入起启位置！");
            }
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            base.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer != null))
            {
                this.icontainer.Dispose();
            }
            base.Dispose(disposing);
        }

        public bool ImportExcel(string filePath)
        {
            this.fileName = filePath;
            try
            {
                DataTable data = ReadWriterExcel.GetData(this.fileName);
                this.gridControl1.DataSource = data;
                this.gridControl1.DefaultView.PopulateColumns();
                this.gridView1.Columns[0].Width = 0x48;
                this.gridView1.Columns[1].Width = 0x128;
                this.gridView1.Columns[2].Width = 0x2d;
                this.gridView1.Columns[3].Width = 0x53;
                this.gridView1.Columns[4].Width = 0x41;
                this.gridView1.Columns[5].Width = 80;
                this.gridView1.Columns[6].Width = 0x4c;
                this.gridView1.Columns[7].Width = 0x4c;
                this.gridView1.Columns[8].Width = 0x48;
                return true;
            }
            catch (Exception exception)
            {
                MsgBox.ShowError("导入清单时出错，请与管理员联系", exception);
                return false;
            }
        }

        public void iniData()
        {
            DBHelp.IniIDA();
            string sql = "select * from JLQD where 1=2";
            this.dtQd = DBHelp.GetDt(sql, "JLQD");
            this.bsJLQD.DataSource = this.dtQd;
        }

        private void InitializeComponent()
        {
            this.icontainer = new Container();
            GridLevelNode node = new GridLevelNode();
            ComponentResourceManager resources = new ComponentResourceManager(typeof(FrmDyqd));
            this.xtraTabControl1 = new XtraTabControl();
            this.xtraTabPage1 = new XtraTabPage();
            this.gridControl1 = new GridControl();
            this.gridView1 = new GridView();
            this.panelControl3 = new PanelControl();
            this.pictureBox1 = new PictureBox();
            this.panelControl1 = new PanelControl();
            this.btnPage1Next = new SimpleButton();
            this.xtraTabPage2 = new XtraTabPage();
            this.tlQD = new TreeList();
            this.colQDBH1 = new TreeListColumn();
            this.colQDMC = new TreeListColumn();
            this.colDW1 = new TreeListColumn();
            this.colQDLX = new TreeListColumn();
            this.repositoryItemComboBox1 = new RepositoryItemComboBox();
            this.colZBDJ = new TreeListColumn();
            this.colHTSL = new TreeListColumn();
            this.colHTJE = new TreeListColumn();
            this.colBZ = new TreeListColumn();
            this.bsJLQD = new BindingSource(this.icontainer);
            this.repositoryItemImageComboBox1 = new RepositoryItemImageComboBox();
            this.repositoryItemLookUpEdit1 = new RepositoryItemLookUpEdit();
            this.panelControl2 = new PanelControl();
            this.simpleButton2 = new SimpleButton();
            this.btnSave = new SimpleButton();
            this.colSGTSL = new TreeListColumn();
            this.colSGTJE = new TreeListColumn();
            this.xtraTabControl1.BeginInit();
            this.xtraTabControl1.SuspendLayout();
            this.xtraTabPage1.SuspendLayout();
            this.gridControl1.BeginInit();
            this.gridView1.BeginInit();
            this.panelControl3.BeginInit();
            this.panelControl3.SuspendLayout();
            ((ISupportInitialize) this.pictureBox1).BeginInit();
            this.panelControl1.BeginInit();
            this.panelControl1.SuspendLayout();
            this.xtraTabPage2.SuspendLayout();
            this.tlQD.BeginInit();
            this.repositoryItemComboBox1.BeginInit();
            ((ISupportInitialize) this.bsJLQD).BeginInit();
            this.repositoryItemImageComboBox1.BeginInit();
            this.repositoryItemLookUpEdit1.BeginInit();
            this.panelControl2.BeginInit();
            this.panelControl2.SuspendLayout();
            base.SuspendLayout();
            this.xtraTabControl1.Dock = DockStyle.Fill;
            this.xtraTabControl1.Location = new Point(0, 0);
            this.xtraTabControl1.Name = "xtraTabControl1";
            this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
            this.xtraTabControl1.Size = new Size(0x39b, 0x1fa);
            this.xtraTabControl1.TabIndex = 0;
            this.xtraTabControl1.TabPages.AddRange(new XtraTabPage[] { this.xtraTabPage1, this.xtraTabPage2 });
            this.xtraTabPage1.Controls.Add(this.gridControl1);
            this.xtraTabPage1.Controls.Add(this.panelControl3);
            this.xtraTabPage1.Controls.Add(this.panelControl1);
            this.xtraTabPage1.Name = "xtraTabPage1";
            this.xtraTabPage1.Size = new Size(0x394, 0x1dc);
            this.xtraTabPage1.Text = "选择导入文件(Excel)";
            this.gridControl1.Dock = DockStyle.Fill;
            node.RelationName = "Level1";
            this.gridControl1.LevelTree.Nodes.AddRange(new GridLevelNode[] { node });
            this.gridControl1.Location = new Point(0, 0x54);
            this.gridControl1.MainView = this.gridView1;
            this.gridControl1.Name = "gridControl1";
            this.gridControl1.Size = new Size(0x394, 0x188);
            this.gridControl1.TabIndex = 6;
            this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView1 });
            this.gridView1.GridControl = this.gridControl1;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsCustomization.AllowFilter = false;
            this.gridView1.OptionsCustomization.AllowGroup = false;
            this.gridView1.OptionsCustomization.AllowQuickHideColumns = false;
            this.gridView1.OptionsCustomization.AllowSort = false;
            this.gridView1.OptionsView.ColumnAutoWidth = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.panelControl3.Controls.Add(this.pictureBox1);
            this.panelControl3.Dock = DockStyle.Top;
            this.panelControl3.Location = new Point(0, 0x24);
            this.panelControl3.Name = "panelControl3";
            this.panelControl3.Size = new Size(0x394, 0x30);
            this.panelControl3.TabIndex = 7;
            this.pictureBox1.ErrorImage = null;
            this.pictureBox1.Image = (Image) resources.GetObject("pictureBox1.Image");
            this.pictureBox1.InitialImage = null;
            this.pictureBox1.Location = new Point(0x13, 2);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new Size(0x361, 0x30);
            this.pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
            this.pictureBox1.TabIndex = 2;
            this.pictureBox1.TabStop = false;
            this.panelControl1.Controls.Add(this.btnPage1Next);
            this.panelControl1.Dock = DockStyle.Top;
            this.panelControl1.Location = new Point(0, 0);
            this.panelControl1.Name = "panelControl1";
            this.panelControl1.Padding = new Padding(3);
            this.panelControl1.Size = new Size(0x394, 0x24);
            this.panelControl1.TabIndex = 0;
            this.btnPage1Next.Dock = DockStyle.Right;
            this.btnPage1Next.Location = new Point(0x359, 5);
            this.btnPage1Next.Name = "btnPage1Next";
            this.btnPage1Next.Size = new Size(0x36, 0x1a);
            this.btnPage1Next.TabIndex = 1;
            this.btnPage1Next.Text = "下一步";
            this.btnPage1Next.Click += new EventHandler(this.btnPage1Next_Click);
            this.xtraTabPage2.Controls.Add(this.tlQD);
            this.xtraTabPage2.Controls.Add(this.panelControl2);
            this.xtraTabPage2.Name = "xtraTabPage2";
            this.xtraTabPage2.Size = new Size(0x377, 0x1dc);
            this.xtraTabPage2.Text = "数据检查";
            this.tlQD.Columns.AddRange(new TreeListColumn[] { this.colQDBH1, this.colQDMC, this.colDW1, this.colQDLX, this.colZBDJ, this.colHTSL, this.colHTJE, this.colSGTSL, this.colSGTJE, this.colBZ });
            this.tlQD.DataSource = this.bsJLQD;
            this.tlQD.Dock = DockStyle.Fill;
            this.tlQD.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            this.tlQD.ImageIndexFieldName = "";
            this.tlQD.Location = new Point(0, 0x20);
            this.tlQD.Name = "tlQD";
            this.tlQD.OptionsView.AutoWidth = false;
            this.tlQD.ParentFieldName = "PID";
            this.tlQD.PreviewFieldName = "QDMC";
            this.tlQD.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemImageComboBox1, this.repositoryItemComboBox1, this.repositoryItemLookUpEdit1 });
            this.tlQD.Size = new Size(0x377, 0x1bc);
            this.tlQD.TabIndex = 8;
            this.tlQD.TreeLineStyle = LineStyle.None;
            this.colQDBH1.Caption = "清单编号";
            this.colQDBH1.FieldName = "QDBH";
            this.colQDBH1.Name = "colQDBH1";
            this.colQDBH1.Visible = true;
            this.colQDBH1.VisibleIndex = 0;
            this.colQDBH1.Width = 0x79;
            this.colQDMC.Caption = "清单名称";
            this.colQDMC.FieldName = "QDMC";
            this.colQDMC.Name = "colQDMC";
            this.colQDMC.Visible = true;
            this.colQDMC.VisibleIndex = 1;
            this.colQDMC.Width = 0x115;
            this.colDW1.Caption = "单位";
            this.colDW1.FieldName = "DW";
            this.colDW1.Name = "colDW1";
            this.colDW1.Visible = true;
            this.colDW1.VisibleIndex = 2;
            this.colDW1.Width = 0x3e;
            this.colQDLX.Caption = "清单类型";
            this.colQDLX.ColumnEdit = this.repositoryItemComboBox1;
            this.colQDLX.FieldName = "QDLX";
            this.colQDLX.Name = "colQDLX";
            this.colQDLX.Width = 0x3d;
            this.repositoryItemComboBox1.AutoHeight = false;
            this.repositoryItemComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemComboBox1.Items.AddRange(new object[] { "普通清单", "计日工", "暂定金" });
            this.repositoryItemComboBox1.Name = "repositoryItemComboBox1";
            this.colZBDJ.Caption = "单价";
            this.colZBDJ.FieldName = "ZBDJ";
            this.colZBDJ.Format.FormatType = FormatType.Numeric;
            this.colZBDJ.Name = "colZBDJ";
            this.colZBDJ.Visible = true;
            this.colZBDJ.VisibleIndex = 4;
            this.colZBDJ.Width = 0x3e;
            this.colHTSL.Caption = "数量";
            this.colHTSL.FieldName = "HTSL";
            this.colHTSL.Format.FormatType = FormatType.Numeric;
            this.colHTSL.Name = "colHTSL";
            this.colHTSL.Visible = true;
            this.colHTSL.VisibleIndex = 3;
            this.colHTSL.Width = 0x41;
            this.colHTJE.Caption = "金额";
            this.colHTJE.FieldName = "HTJE";
            this.colHTJE.Format.FormatType = FormatType.Numeric;
            this.colHTJE.Name = "colHTJE";
            this.colHTJE.Visible = true;
            this.colHTJE.VisibleIndex = 5;
            this.colHTJE.Width = 0x5d;
            this.colBZ.Caption = "备注";
            this.colBZ.FieldName = "BZ";
            this.colBZ.Name = "colBZ";
            this.colBZ.Width = 0x93;
            this.repositoryItemImageComboBox1.AutoHeight = false;
            this.repositoryItemImageComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemImageComboBox1.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("", "1", 1), new ImageComboBoxItem("", "2", 5), new ImageComboBoxItem("", "3", 11) });
            this.repositoryItemImageComboBox1.Name = "repositoryItemImageComboBox1";
            this.repositoryItemLookUpEdit1.AutoHeight = false;
            this.repositoryItemLookUpEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemLookUpEdit1.Name = "repositoryItemLookUpEdit1";
            this.panelControl2.Controls.Add(this.simpleButton2);
            this.panelControl2.Controls.Add(this.btnSave);
            this.panelControl2.Dock = DockStyle.Top;
            this.panelControl2.Location = new Point(0, 0);
            this.panelControl2.Name = "panelControl2";
            this.panelControl2.Padding = new Padding(3);
            this.panelControl2.Size = new Size(0x377, 0x20);
            this.panelControl2.TabIndex = 7;
            this.simpleButton2.Dock = DockStyle.Left;
            this.simpleButton2.Location = new Point(5, 5);
            this.simpleButton2.Name = "simpleButton2";
            this.simpleButton2.Size = new Size(0x36, 0x16);
            this.simpleButton2.TabIndex = 2;
            this.simpleButton2.Text = "上一步";
            this.simpleButton2.Click += new EventHandler(this.simpleButton2_Click);
            this.btnSave.Dock = DockStyle.Right;
            this.btnSave.Location = new Point(0x344, 5);
            this.btnSave.Name = "btnSave";
            this.btnSave.Size = new Size(0x2e, 0x16);
            this.btnSave.TabIndex = 1;
            this.btnSave.Text = "确定";
            this.btnSave.Click += new EventHandler(this.btnSave_Click);
            this.colSGTSL.Caption = "施工图数量";
            this.colSGTSL.FieldName = "SGTSL";
            this.colSGTSL.Name = "colSGTSL";
            this.colSGTSL.Visible = true;
            this.colSGTSL.VisibleIndex = 6;
            this.colSGTJE.Caption = "施工图金额";
            this.colSGTJE.FieldName = "SGTJE";
            this.colSGTJE.Name = "colSGTJE";
            this.colSGTJE.Visible = true;
            this.colSGTJE.VisibleIndex = 7;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x39b, 0x1fa);
            base.Controls.Add(this.xtraTabControl1);
            base.Name = "FrmDyqd";
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text = "清单导入";
            this.xtraTabControl1.EndInit();
            this.xtraTabControl1.ResumeLayout(false);
            this.xtraTabPage1.ResumeLayout(false);
            this.gridControl1.EndInit();
            this.gridView1.EndInit();
            this.panelControl3.EndInit();
            this.panelControl3.ResumeLayout(false);
            this.panelControl3.PerformLayout();
            ((ISupportInitialize) this.pictureBox1).EndInit();
            this.panelControl1.EndInit();
            this.panelControl1.ResumeLayout(false);
            this.xtraTabPage2.ResumeLayout(false);
            this.tlQD.EndInit();
            this.repositoryItemComboBox1.EndInit();
            ((ISupportInitialize) this.bsJLQD).EndInit();
            this.repositoryItemImageComboBox1.EndInit();
            this.repositoryItemLookUpEdit1.EndInit();
            this.panelControl2.EndInit();
            this.panelControl2.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void method(object sender, EventArgs e)
        {
        }

        private int method1(string _str)
        {
            int num = 0;
            if (_str.Contains(GParams.JRGCode))
            {
                return 1;
            }
            if (_str.Contains(GParams.ZDJCode))
            {
                num = 2;
            }
            return num;
        }

        private string method2(Dictionary<string, decimal> qdList)
        {
            return "";
        }

        private void method3(DataRow dataRow, int numD)
        {
            if (!dataRow["CJM"].Equals("0"))
            {
                dataRow["CJM"] = numD;
            }
        }

        private void method4(DataTable dataTable, DataTable dataTable1)
        {
            try
            {
                Stack<DataRow> stack = new Stack<DataRow>();
                DataRow row = null;
                string str = "";
                int num = 0;
                string str2 = "";
                Dictionary<string, decimal> dictionary = new Dictionary<string, decimal>();
                string str3 = "";
                foreach (DataRow row2 in dataTable.Rows)
                {
                    DataRow row3;
                    string str6;
                    string str7;
                    str = row2["F1"].ToString().Replace("－", "-").Replace(" ", "");
                    if (!str.Equals("") && ((((str.Length == 3) || str.Contains(GParams.JRGCode)) || str.Contains(GParams.ZDJCode)) || str.Contains("-")))
                    {
                        str2 = Guid.NewGuid().ToString();
                        row3 = dataTable1.NewRow();
                        num = this.method1(str);
                        row3["id"] = str2;
                        row3["xmid"] = this.xmid;
                        row3["bdid"] = this.bdid;
                        row3["QDBH"] = str;
                        row3["QDMC"] = row2["F2"];
                        row3["DW"] = row2["F3"];
                        row3["BGHSL"] = 0;
                        row3["HTSL"] = 0;
                        row3["HTJE"] = 0;
                        row3["BGHSL"] = 0;
                        row3["BGHJE"] = 0;
                        row3["DJZD"] = 0;
                        row3["ZXZDJ"] = 0;
                        row3["ZBDJ"] = 0;
                        row3["XXDJ"] = 0;
                        row3["zbcd"] = 0;
                        row3["QDLX"] = num;
                        row3["SGTSL"] = 0;
                        row3["HTJE"] = 0;
                        row3["SGTSL"] = 0;
                        row3["SGTJE"] = 0;
                        decimal result = 0M;
                        if (decimal.TryParse(row2["F4"].ToString(), out result))
                        {
                            row3["HTSL"] = result;
                            if (result > 0M)
                            {
                                row3["ZKCJBL"] = this.CJBL;
                            }
                        }
                        result = 0M;
                        if (decimal.TryParse(row2["F5"].ToString(), out result))
                        {
                            row3["ZBDJ"] = result;
                        }
                        result = 0M;
                        if (decimal.TryParse(row2["F6"].ToString(), out result))
                        {
                            row3["HTJE"] = result;
                        }
                        if (decimal.TryParse(row2["F7"].ToString(), out result))
                        {
                            row3["SGTSL"] = result;
                        }
                        if (decimal.TryParse(row2["F8"].ToString(), out result))
                        {
                            row3["SGTJE"] = result;
                        }
                        dataTable1.Rows.Add(row3);
                        if (str.Substring(0, 1).Equals("Z"))
                        {
                            str = str;
                        }
                        string str4 = str.Substring(0, 1);
                        if (((((str.Length == 3) && !str4.Equals(GParams.JRGCode)) && !str4.Equals(GParams.ZDJCode)) || str.Equals(GParams.JRGCode)) || str.Equals(GParams.ZDJCode))
                        {
                            row3["CJM"] = 0;
                            str3 = str;
                            dictionary.Add(str, CHelp.ConvertDecimal(row3["HTJE"], 0, 0));
                        }
                        else
                        {
                            Dictionary<string, decimal> dictionary2;
                            string str5;
                            (dictionary2 = dictionary)[str5 = str3] = dictionary2[str5] + CHelp.ConvertDecimal(row3["HTJE"], 0, 0);
                        }
                        if (stack.Count == 0)
                        {
                            row3["PID"] = "-1";
                            stack.Push(row3);
                        }
                        else
                        {
                            row = stack.Peek();
                            str6 = row["QDBH"].ToString();
                            str7 = row2["F1"].ToString();
                            int length = str7.Split(new char[] { '-' }).Length;
                            int num4 = str6.Split(new char[] { '-' }).Length;
                            if (num4 == length)
                            {
                                row3["PID"] = row["PID"];
                                this.method3(row3, CHelp.ConvertInt(row["CJM"], 0) + 1);
                                stack.Push(row3);
                            }
                            else
                            {
                                if (num4 >= length)
                                {
                                    goto Label_05E2;
                                }
                                row3["PID"] = row["ID"];
                                this.method3(row3, CHelp.ConvertInt(row["CJM"], 0) + 1);
                                stack.Push(row3);
                            }
                        }
                    }
                    continue;
                Label_0592:
                    stack.Pop();
                    if (stack.Count > 0)
                    {
                        row = stack.Peek();
                        str6 = row["QDBH"].ToString();
                    }
                    else
                    {
                        str6 = "";
                        row3["PID"] = "-1";
                        stack.Push(row3);
                    }
                Label_05E2:;
                    if (str6.Split(new char[] { '-' }).Length > str7.Split(new char[] { '-' }).Length)
                    {
                        goto Label_0592;
                    }
                    if (!str6.Equals(""))
                    {
                        row3["PID"] = row["PID"];
                        this.method3(row3, CHelp.ConvertInt(row["CJM"], 0) + 1);
                        stack.Push(row3);
                    }
                }
                foreach (KeyValuePair<string, decimal> pair in dictionary)
                {
                    DataRow row4 = dataTable1.Select("qdbh='" + pair.Key + "'")[0];
                    row4["HTJE"] = pair.Value;
                }
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            this.xtraTabControl1.SelectedTabPageIndex--;
        }
    }
}

